<template>
  <el-tooltip v-delTabIndex :class="['tooltip-wraper', 'tooltip-' + type]" effect="dark" :content="content" placement="top">
    <template #content>
      <slot name="bbbbbbb" />
    </template>
    <i v-if="icon" :class="[iconList[icon] ? iconList[icon] : `${icon} iconfont`]" @click="handleTipDo" />
  </el-tooltip>
</template>
<script>

export default {
  props: {
    type: {
      type: String
    },
    content: String,
    icon: String
  },
  data() {
    return {
      iconList: {
        edit: 'el-icon-edit-outline',
        delete: 'el-icon-delete',
        refresh: 'el-icon-refresh',
        operation: 'el-icon-s-operation',
        check: 'el-icon-circle-check',
        warning: 'l-icon-warning-outline',
        tickets: 'el-icon-tickets',
        plus: 'el-icon-circle-plus-outline'
      }
    }
  },
  methods: {
    handleTipDo() { // 操作
      this.$emit('click')
    }
  }
}
</script>
<style lang="less" scoped>
.tooltip-wraper {
  cursor: pointer;
  font-size: 16px;
  margin-right: 10px;
  color: #217dfa;
}

.tooltip-warning {
  color: #FF4949;
}

.tooltip-mark {
  color: #FE8B50;
}
</style>
